# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=python-flask-httpauth
_pkgname=Flask-HTTPAuth
pkgver=4.8.0
pkgrel=1
pkgdesc='Basic, Digest and Token HTTP authentication for Flask routes'
url='https://github.com/miguelgrinberg/Flask-HTTPAuth'
arch=('any')
license=('MIT')
depends=('python' 'python-flask' 'python-setuptools')
checkdepends=('python-pytest')
source=(https://github.com/miguelgrinberg/${_pkgname}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha512sums=('0e32daf09d384b6e90c0ad64c2ce56ebd14c4208f11b47ba69aa490fb1d7b5d5d26c5b630aa016746716bff1f0a31df7e18b4ffcdd0578a70009fc8037f8a870')
b2sums=('2159d40c0879a15a9ae2ad9604436dd8d24afa0d431b621c3ae1c63b26c216395401a974b21163f25a86755daeed653fe3a2ff48fbba00f786e49c8e061f1ad0')

build() {
  cd ${_pkgname}-${pkgver}
  python setup.py build
}

check() {
  cd ${_pkgname}-${pkgver}
  PYTHONPATH=src/ pytest -k "not async" tests/
}

package() {
  cd ${_pkgname}-${pkgver}
  python setup.py install --skip-build -O1 --root="${pkgdir}"
  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
